/**
 * Created by Administrator on 2017/6/12.
 */
"use strict";

const express = require('express');
const app = express();

app.get('/', (req, response) => {
	response.writeHead(200, {'Content-Type': 'text/html'});
	// 发送响应数据 "Hello World"
	response.write('<h3>nodeJSchange1</h3>');
	response.write('<h3>nodeJSchange2</h3>');
	response.write('<h3>nodeJSchange3</h3>');
	response.end('Hello World\n');
});

function getsvg(title, color, label, flat) {
	return JSON.stringify({
		title:title,
		color:color,
		label:label,
		flat:flat
	})
}

// note：这里用到一个环境变量
let port = process.env.HTTP_PORT || 8888;

app.listen(port, () => {
	console.log('Listening on port %s', port);
});